<div class="layuimini-container">
    <form id="app-form" class="layui-form layuimini-form">
        

        <div class="layui-form-item">
            <label class="layui-form-label required">用户名(必填):</label>
            <div class="layui-input-block">
                <input autocomplete="off" type="text" name="username" class="layui-input" lay-verify="required" lay-reqtext="请输入用户名" placeholder="请输入用户名" value="{$row.username}">
                <tip>填写用户名</tip>
            </div>
        </div>

        <!-- <div class="layui-form-item">
            <label class="layui-form-label required">用户昵称(必填):</label>
            <div class="layui-input-block">
                <input type="text" name="nickname" class="layui-input" lay-verify="required" lay-reqtext="请输入用户昵称" placeholder="请输入用户昵称" value="{$row.nickname}">
                <tip>填写用户昵称</tip>
            </div>
        </div> -->


        <!-- 用户组 -->
        <div class="layui-form-item">
            <label class="layui-form-label required">用户组</label>
            <div class="layui-input-block">
                <select name="group" lay-filter="group" id="group">
                    {foreach $groups as $vo}
                    <option value="{$vo.value}" {if $row.group==$vo.value}selected=""{/if}>{$vo.label}</option>
                    {/foreach}
                </select>
            </div>
        </div>

        <!-- 房间号 -->
        <div class="layui-form-item" id="rooms" {if session("admin.group") != 1 && session("admin.group") != 5}style="display:none"{/if}>
            <label class="layui-form-label">房间号</label>
            <div class="layui-input-block">
                {foreach $rooms as $vo}
                    <input autocomplete="off" type="checkbox" name="rooms[]" {if in_array($vo.roomid,$row.rooms)}checked=""{/if} title="{$vo.roomid}" value='{$vo.roomid}'>
                {/foreach}
            </div>
        </div>

        <!-- 房间号 -->
        <div class="layui-form-item" id="roomOnly" {if session("admin.group") == 1 || session("admin.group") == 5}style="display:none"{/if}>
            <label class="layui-form-label">房间号</label>
            <div class="layui-input-block">
                <select name="room_only">
                    {foreach $rooms as $vo}
                        <option value="{$vo.roomid}" {if in_array($vo.roomid,$row.rooms)}selected=""{/if}>{$vo.roomid}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        
        <div class="hr-line"></div>
        <div class="layui-form-item text-center">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit>确认</button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">重置</button>
        </div>

    </form>
</div>